import { Component, OnInit, Input } from '@angular/core';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.less']
})
export class HeaderComponent implements OnInit {

  // 获取父组件数据
  @Input('message') msgmsg: string
  // 获取父组件方法
  @Input('runFn') runChild: any
  // 获取整个父组件
  @Input('com') parament: any


  constructor() { }

  ngOnInit(): void {
  }

  ngAfterViewInit(): void {
    //Called after ngAfterContentInit when the component's view has been initialized. Applies to components only.
    //Add 'implements AfterViewInit' to the class.
    console.log('this.msgmsg---', this.msgmsg)
  }

  run() {
    console.log('header里面的run方法')
    this.runChild()
    this.parament.run()
  }

}
